<!DOCTYPE html> 
<html>
<head>
  <title>Pong!</title> 
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
  <link href="pong.css" media="screen, print" rel="stylesheet" type="text/css" /> 
</head> 
 
<body> 

  <div id="sidebar">

    <h2>This is Pong!</h2>

    <div class='description'>
      <p>
        This is a javascript version of Pong.
      </p>
      <p>
        Press <b>1</b> for a single player game.<br>
        Press <b>2</b> for a double player game.<br>
      </p>
      <p>
        <b>Controls:</b><br>
        Player 1: <b>Up</b> and <b>Down</b> arrow keys.<br>
        Player 2: <b>Q</b> and <b>A</b> keys.
      </p>
      <p>
        <b>Esc</b> can be used to abandon a game.
      </p>
    </div>

    <div class='settings'>
      <label for='sound'>sound: </label>
      <input type='checkbox' id='sound'>
    </div>

    <div class='settings'>
      <label for='stats'>stats: </label>
      <input type='checkbox' id='stats' checked>
    </div>

    <div class='settings'>
      <label for='footprints'>footprints: </label>
      <input type='checkbox' id='footprints'>
    </div>

  </div>

  <canvas id="game">
    <div id="unsupported">
      Sorry, this example cannot be run because your browser does not support the &lt;canvas&gt; element
    </div>
  </canvas>

  <script src="game.js" type="text/javascript"></script> 
  <script src="pong.js" type="text/javascript"></script>
  <script type="text/javascript">
  Game.ready(function() {

    var size        = document.getElementById('size');
    var sound       = document.getElementById('sound');
    var stats       = document.getElementById('stats');
    var footprints  = document.getElementById('footprints');
    // var predictions = document.getElementById('predictions');

    var pong = Game.start('game', Pong, {
      sound:       sound.checked,
      stats:       stats.checked,
      footprints:  footprints.checked,
      // predictions: predictions.checked
    });

    Game.addEvent(sound,       'change', function() { pong.enableSound(sound.checked);           });
    Game.addEvent(stats,       'change', function() { pong.showStats(stats.checked);             });
    Game.addEvent(footprints,  'change', function() { pong.showFootprints(footprints.checked);   });
    // Game.addEvent(predictions, 'change', function() { pong.showPredictions(predictions.checked); });

  });
  </script>

</body> 
</html>
